﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Presentation.Shell.Interfaces;
using Microsoft.Practices.Unity;
using Presentation.Module.Scheduling.Interfaces;
using Presentation.Module.StudyDefinition.ViewDto;
using Presentation.Module.Scheduling;
using Presentation.Module.Scheduling.Interfaces.Views;
using Presentation.Module.Scheduling.Interfaces.ViewModels;
using Presentation.Module.Scheduling.Interfaces.Services;
using System.Windows;

namespace Presentation.Module.Scheduling
{
    public class ScheduleStudyModule : IPresentationModule
    {
         public IUnityContainer Container { get; private set; }

        public ScheduleStudyModule(IUnityContainer container)
        {
            // Keep an instance of the container for later use
            this.Container = container;
            
            #warning move to config file
            // register mappings from interfaces to implementations, standard Dependency Injection stuff.
            container.RegisterType<IScheduleStudyView, ScheduleStudyView>();
            
        }

        // this name isb used for display on the menu
        public string Name
        {
            get
            {
                return "VPL Schedule Study";
            }
        }

        // Provide a ModuleLandingPage to Render when control passes to the selected module
        public IModuleLandingPage LandingPage
        {
            get 
            {
                return Container.Resolve<SchedulingLandingPage>();
            }
        }
    }

#warning delete this
    
    public class MockSkillService : IScheduleStudyService
    {
        public List<ViewDto.ScheduleStudy> GetAllScheduleStudies()
        {
            return  new List<Module.Scheduling.ViewDto.ScheduleStudy>
            {
                new Module.Scheduling.ViewDto.ScheduleStudy{ Id=1, StudyToSchedule = new Study()   , StartWeekDate = DateTime.Now , EndWeekDate = DateTime.Now.Add(new TimeSpan(7,1,1,1)) },
                
            };    
        }

        public void EditScheduleStudy(ViewDto.ScheduleStudy schedulestudy)
        {
            MessageBox.Show("Show edit view and edit " + schedulestudy.Id.ToString());
        }

        public void RemoveScheduleStudy(ViewDto.ScheduleStudy schedulestudy)
        {
            MessageBox.Show("Prompt for remove and remove if yes " + schedulestudy.Id);   
        }

        public void AddScheduleStudy(ViewDto.ScheduleStudy schedulestudy)
        {            
            MessageBox.Show("Show add view and add " + schedulestudy.Id);
        }
    }
    }
}
